<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="flex-box border-hover-style">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img
        v-if="props.info.value"
        class="outline-parent-bg"
        :src="publicUrls + 'free/style17/Level2outlineStyle1.webp'"
        alt=""
      />
      <img v-else class="outline-parent-bg" :src="publicUrls + 'free/style17/Level2outlineStyle1-2.webp'" alt="" />
      <div
        class="outline"
        :class="
          !props.info.value && props.info.subTitle
            ? 'outline-flex'
            : !props.info.value && !props.info.subTitle && 'outline-flex2'
        "
      >
        <div class="outline-content">
          <div class="centent">
            <div class="titleBox">
              <img class="titlebg" :src="publicUrls + 'free/style17/Level2outlineStyle1TitleBg1.webp'" alt="" />
              <div class="content-box-right">{{ props.info.text }}</div>
              <img class="titlebg" :src="publicUrls + 'free/style17/Level2outlineStyle1TitleBg2.webp'" alt="" />
            </div>
            <p class="outline-subTitle" v-if="props.info.subTitle" @click="ImgVisible = true">
              {{ props.info.subTitle }}
            </p>
          </div>
          <div
            class="cover"
            v-if="props.info.value"
            @click="ImgVisible = true"
            :class="{ 'cover-no': !props.info.remarks || !props.info.subTitle }"
          >
            <div class="cover-box">
              <img class="outline-cover" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
            <img class="imgBg" :src="publicUrls + 'free/style17/Level2outlineStyle1Img.webp'" alt="" />
          </div>
          <TextMax
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :infoData="props.info"
            :row="props.info.value ? 3 : 5"
          ></TextMax>
        </div>
      </div>
    </div>
    <!-- <img class="shadow" :src="publicUrls + 'free/style4/firstLevelOutline2Shadow.png'" alt="" /> -->
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free17Style1',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import textMode from '../../../textMode/textMode.vue';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style17.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-left: 80px;
  margin-right: 90px;
}
.icon-3d {
  width: 37px;
  height: 47px;
  object-fit: contain;
  position: absolute;
  top: 9px;
  right: 120px;
  z-index: 21;
}
.shadow {
  width: 640px;
  height: 234px;
  position: absolute;
  bottom: 0;
  left: 0;
}
.Showroom-parent {
  position: absolute;
  top: 42px;
  left: 47px;
  z-index: 21;
}
.flex-box {
  width: 412px;
  height: 774px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
}
.outline {
  z-index: 20;
  width: 100%;
  height: 100%;
  padding: 177px 77px 157px 25px;
}
.outline-flex {
  padding: 218px 64px 157px 28px !important;
  .outline-content {
    justify-content: space-between !important;
  }
  .textMore-box {
    padding-right: 20px;
  }
}
.outline-flex2 {
  padding: 263px 64px 157px 28px !important;
  .outline-content {
    justify-content: space-between !important;
  }
  .textMore-box {
    padding-right: 20px;
  }
}
.outline-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}
.titleBox {
  display: flex;
  align-items: center;
  margin-left: 47px;
  margin-bottom: 10px;
  .content-box-right {
    color: #7f1a10;
    text-align: center;
    font-family: 'SJxingkai-C';
    font-size: 24px;
    line-height: 36px;
  }
  .titlebg {
    width: 29px;
    height: 48px;
  }
}
.outline-subTitle {
  width: 280px;
  color: rgba(116, 22, 21, 0.8);
  text-align: center;
  font-family: 'PingFang SC';
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  margin-left: 47px;
  margin-bottom: 10px;
  opacity: 0.8;
}
.cover-no {
  width: 250px !important;
  height: 244px !important;
}
.cover {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 207px;
  height: 202px;
  overflow: hidden;
  border-radius: 100%;
  flex-shrink: 0;
  margin-bottom: 20px;
  margin-left: 34px;
  position: relative;
  overflow: hidden;
  padding: 2px;
  &:hover .cover-box > img {
    transform: scale(1.2);
  }
  .cover-box {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 100%;

    .outline-cover {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 100%;
      transition: all 0.3s ease;
    }
  }
  .imgBg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
  }
}
::v-deep .van-text-ellipsis {
  text-align: justify;
  font-family: PingFang SC !important;
  font-size: 16px !important;
  line-height: 30px !important;
  color: rgba(116, 22, 21, 0.8) !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: rgba(116, 22, 21, 1) !important;
  font-weight: 600 !important;
  font-family: 'PingFangSC';
}
</style>